package com.go.where.family.service.impl;

import java.util.Date;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.go.where.family.dao.TopicDao;
import com.go.where.family.pojo.TopicInfo;
import com.go.where.family.service.TopicService;

@Service("topicService")
public class TopicServiceImpl implements TopicService {

	@Resource(name = "topicDao")
	private TopicDao topicDao;

	@Override
	public List<TopicInfo> queryList(Map<String, Object> map) {
		return topicDao.queryT(map);
	}

	@Override
	public TopicInfo queryTopicDetail(String topicId) {
		TopicInfo topic = new TopicInfo();
		topic.setTopicId(topicId);
		return topicDao.queryByPrimaryKey(topic);
	}

	@Override
	public int update(TopicInfo topicInfo) {
		topicInfo.setUpdateTime(new Date());
		return topicDao.update(topicInfo);
	}

}
